const Validate = require('@/validate/index');

class UserController {
    // 用户登录
    async wxlogin(ctx) {
        const { name, age } = ctx.request.body;
        await Validate.nullCheck(name, '请填写姓名', 'name');
        await Validate.nullCheck(age, '请填写年龄', 'age');
        console.log(name);
        console.log(age);
        // 成功响应
        ctx.send({ name, age }, 200, '登录成功');
    }
}
module.exports = new UserController();